<?php
/**
 * Created by JetBrains PhpStorm.
 * User: q
 * Date: 14-8-17
 * Time: 上午11:36
 * To change this template use File | Settings | File Templates.
 */
class curve extends CI_Controller{
    public function __construct(){
        error_reporting(0);
        parent::__construct();
    }
    public function index(){
        $openid = $_GET['openid'];
        $this->db->where('openid',$openid);
        $this->db->order_by('date','asc');
        $exist = $this->db->get('ke_weights')->result_array();
        foreach($exist as $key => $val){
            $arr['weight'][$key] = "'".$val['weight']."'";
            $arr['date'][$key] = "'".date('Y-m-d',$val['date'])."'";
        }
        $data['weight'] = implode(',',$arr['weight']);
        $data['date'] = implode(',',$arr['date']);
        $this->load->view('curve/index',$data);
    }
}